package com.lkd.mapper;


import com.lkd.dto.UserPageDto;
import com.lkd.entity.User;
import com.lkd.vo.UserVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper{

    //用户登录
    @Select("select * from lkdremake.tb_user where login_name=#{loginName}")
    User login(String loginName);

    //用户分页
    List<UserVo> search(UserPageDto userPageDto);

    //用户添加
    @Insert("insert into lkdremake.tb_user values (null,#{roleId},#{userName},#{loginName},#{password},#{secret},#{roleCode},#{mobile},#{regionId},#{regionName},#{status},#{image})")
    Boolean save(User user);

    //用户修改
    Boolean update(User user);

    //用户删除
    @Select("delete from lkdremake.tb_user where id=#{userId}")
    Boolean delete(Integer userId);
}
